<template>
<div class="app-container">
  <!-- 表单查询  -->
  <el-form :inline="true" class="demo-form-inline">
   <el-form-item label="请选择地区">
    <el-select v-model="did" >
            <el-option
                v-for="l in regions"
                :key="l.value"
                :label="l.codeName"
                :value="l.value"> 
            </el-option>
    </el-select  >
  </el-form-item>
 
   <el-button type="primary" icon="el-icon-search" @click="getList()">查询</el-button>
</el-form>

  <!-- banner列表 -->
  <el-table :data="yyts" stripe style="width: 100%">
      <el-table-column type="index" width="50"/>
      <el-table-column prop="yname" label="营业厅名称"/>
      <el-table-column prop="dname" label="地区"/>
      <el-table-column fixed="right" label="操作" width="200">
        <template slot-scope="scope">
              <router-link :to="'/ggkConfig/edit/'+scope.row.yid">
                <el-button type="primary" size="mini" icon="el-icon-edit">配置</el-button>
              </router-link>
        </template>
      </el-table-column>
  </el-table>
</div>
</template>
<script>
//引入api接口
import ggkConfig from "@/api/ggkConfig";

export default {
  // 定义数据模型
  data() {
    return {
     yyts:[],
     regions:[],
     leveAndLp:{},
     did:'1'
    }
  },
  // 页面渲染成功后获取数据
  created() {
    this.getList()
    this.getAdds()

  },

  methods: {//定义方法对api接口的方法调用
      //营业厅列表
    getList (){
      ggkConfig.getYytList(this.did)
      .then(res =>{//请求成功
          this.yyts=res.data
          console.log(res)
      })
    },

    getAdds(){
      ggkConfig.getAddress()
        .then(res =>{
          this.regions=res.data
           console.log(res)
        })
    }
  }
};
</script>